package fun.coding.linkedlist;

public class LinkedListMain {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
	    /*
		SimpleLinkedList sll = new SimpleLinkedList();
		for(int i = 1; i < 4; i++) {
			sll.insert(i);
		}
		sll.print();
		
		SimpleLinkedList sll1 = new SimpleLinkedList();
		for(int i = 6; i < 9; i++) {
			sll1.insert(i);
		}
		sll1.print();
		
//		LinkedListManipulation llm = new LinkedListManipulation();
//		llm.interpolateList(sll);
//		
//		sll.print();
		
		LinkedListManipulation llm = new LinkedListManipulationImpl();
		
		Node n = llm.addTwoNumbers(sll.getHead(), sll1.getHead());
		
		n = n.getNext();
		while(n != null) {
			System.out.print(n.getValue() + " ");
			n = n.getNext();
		}
		System.out.println();
		*/
	    SimpleLinkedList sll = new SimpleLinkedList();
        for(int i = 0; i < 6; i++) {
            sll.insert(i);
        }
        sll.print();
        
        LinkedListManipulation llm = new LinkedListManipulationImpl();
        /*
        Node newHead = llm.reverseLinkedList(sll.getHead());
        while(newHead != null) {
            System.out.print(newHead.getValue() + " ");
            newHead = newHead.getNext();
        }
        */
        Node newHead = llm.swapLinkedList(sll.getHead());
        while(newHead != null) {
            System.out.print(newHead.getValue() + " ");
            newHead = newHead.getNext();
        }
	}

}
